package com.sso.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name = "sso_DicUserHuman")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@NamedQueries( {
	@NamedQuery(name = "duh.getUserHumanBySystemId", query = "select ur from DicUserHuman as ur where ur.user.id=? and ur.human.system.id=?")})
public class DicUserHuman {
	
	/**
	 * ID
	 */
	@Id
	private String id;
	
	/**
	 * 系统标识
	 */
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "humanId")
	private DicHuman human;
	
	/**
	 * 用户ID
	 */
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "userId")
	private DicSystemUser user;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public DicHuman getHuman() {
		return human;
	}

	public void setHuman(DicHuman human) {
		this.human = human;
	}

	public DicSystemUser getUser() {
		return user;
	}

	public void setUser(DicSystemUser user) {
		this.user = user;
	}
	
	
}
